[IA64] define VHPT_ENABLED in Rules.mk instead of the header file, vhpt.h.
authorIsaku Yamahata <yamahata@valinux.co.jp>
Wed, 7 May 2008 08:15:32 +0000 (17:15 +0900)
committerIsaku Yamahata <yamahata@valinux.co.jp>
Wed, 7 May 2008 08:15:32 +0000 (17:15 +0900)
VHPT_ENABLED is defined in vhpt.h, but it is intended for compile time
option. Defining in the header file caused that VHPT_ENABLED
is undefined in some files resulting in unintentional compilation.
Define the macro in Rules.mk resolves it. And minor modifications to
remove compilation error/warning.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
xen/arch/ia64/Rules.mk
xen/arch/ia64/asm-offsets.c
xen/arch/ia64/xen/domain.c
xen/include/asm-ia64/vhpt.h

index d1568cf90f85a701c6748b71e0599d47201428c5..dfdfb2a510db6782b4a1454863d9304eb9727742 100644 (file)
@@ -8,6 +8,7 @@ xenoprof := y
 no_warns ?= n
 vti_debug ?= n
 vmx_panic ?= n
+vhpt_disable ?= n
 xen_ia64_expose_p2m    ?= y
 xen_ia64_pervcpu_vhpt  ?= y
 xen_ia64_tlb_track     ?= y
@@ -45,6 +46,9 @@ CFLAGS        += -DCONFIG_XEN_IA64_EXPOSE_P2M
 endif
 ifeq ($(xen_ia64_pervcpu_vhpt),y)
 CFLAGS += -DCONFIG_XEN_IA64_PERVCPU_VHPT
+ifeq ($(vhpt_disable),y)
+$(error "both xen_ia64_pervcpu_vhpt=y and vhpt_disable=y are enabled. they can't be enabled simultaneously. disable one of them.")
+endif
 endif
 ifeq ($(xen_ia64_tlb_track),y)
 CFLAGS += -DCONFIG_XEN_IA64_TLB_TRACK
@@ -58,6 +62,11 @@ endif
 ifeq ($(no_warns),y)
 CFLAGS += -Wa,--fatal-warnings -Werror -Wno-uninitialized
 endif
+ifneq ($(vhpt_disable),y)
+CFLAGS += -DVHPT_ENABLED=1
+else
+CFLAGS += -DVHPT_ENABLED=0
+endif
 
 LDFLAGS := -g
 
index 55678f0ce736e2f001da85fa723db4d345122361..8f2f87ba8bbf5676728e229e3524701fef67d45b 100644 (file)
@@ -254,10 +254,12 @@ void foo(void)
        DEFINE(IA64_MCA_CPU_RBSTORE_OFFSET,
               offsetof(struct ia64_mca_cpu, rbstore));
 
+#if VHPT_ENABLED
        DEFINE(IA64_VCPU_VHPT_PAGE_OFFSET,
               offsetof(struct vcpu, arch.vhpt_page));
        DEFINE(IA64_VCPU_VHPT_MADDR_OFFSET,
               offsetof(struct vcpu, arch.vhpt_maddr));
+#endif
 
        BLANK();
        DEFINE(IA64_MCA_TLB_INFO_SIZE, sizeof(struct ia64_mca_tlb_info));
index 70831508aae87298ba2a7e7eaaa19426d74c6518..95d9b0ec1d0f5ca7b4c1f22adb8f908164f47d32 100644 (file)
@@ -499,10 +499,9 @@ static void vcpu_share_privregs_with_guest(struct vcpu *v)
 
 int vcpu_late_initialise(struct vcpu *v)
 {
-       struct domain *d = v->domain;
        int rc, order;
 
-       if (HAS_PERVCPU_VHPT(d)) {
+       if (HAS_PERVCPU_VHPT(v->domain)) {
                rc = pervcpu_vhpt_alloc(v);
                if (rc != 0)
                        return rc;
index 54b3bd8837d5bb86834f58221c4832fa26d94568..e5f148ecd11bcc2e4aaa50d048c4ad5e3eb6e851 100644 (file)
@@ -1,8 +1,6 @@
 #ifndef ASM_VHPT_H
 #define ASM_VHPT_H
 
-#define VHPT_ENABLED 1
-
 /* Size of the VHPT.  */
 // XXX work around to avoid trigerring xenLinux software lock up detection.
 # define       VHPT_SIZE_LOG2                  16      // 64KB